\(minimum[s_List /; VectorQ[s, NumberQ]] := 
	
      Which[s == {}, Infinity, 
		\ \ \ \ \ Length[s] == 1, 
        s[\([1]\)], 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ s[\([1]\)]\  > \ 
          s[\([2]\)], \ 
        minimum[Drop[s, {1}]], 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ True, \ 
        minimum[Drop[s, {2}]]]\)

minimum[{9, 3, 7, 5, 5, 2, 1, 7, 4, 9, 6}]

minimum[{}]

Min[{10, 5, 15}]

Min[{}]

Clear["`*"];  
\(ourmax1[x_List] := 
      Module[{maxnum = x[\([1]\)], k = 1}, 
		Do[
          If[x[\([i]\)]\  > \ maxnum, maxnum = x[\([i]\)]; k = i], {i, 2, 
            Length[x]}]; 
		{maxnum, k}]\)

ourmax1[{2, 5, -3, 6, 4, 18, -5, 0, 2, 7}]

{2, 5, -3, 6, 4, 18, -5, 0, 2, 7}[[6]]

\(Clear["`*"];  (*max*) 

    ourmax[x_List] := 
      Module[{maxnum = x[\([1]\)]}, 
		Do[
          If[x[\([i]\)]\  > \ maxnum, maxnum = x[\([i]\)]], {i, 2, 
            Length[x]}]; 
		maxnum]\)

ourmax[{2, 5, -3, 6, 4, 18, -5, 0, 2, 7}]

\(Clear["`*"];  (*max*) 

    m[{x_, y_, z___}\  /; x > y] := m[{x, z}]\)
m[{x_, y_, z___}  /; x <= y] := m[{y, z}]
m[{x_}] := x

?m

m[{1, 8, 4, -3, 5, -6, 9, 3, 0, -7, 7, 10, -8, -2, 
        6}]

\(\(\( (*\ max\ min\ *) \)\(
\)\(Clear["`*"];\)\)\)

g[x_, y_] := y   /;  x >= y
g[x_, y_] := x  /;  x < y

f[x_, y_] := x   /;  x >= y
f[x_, y_] := y  /;  x < y

\(minmax[s_List /; Length[s] > 0] := 
      Module[{m, m1, m2}, 
	
        Which[Length[s] == 1, {s[\([1]\)], 
            s[\([1]\)]}, 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ True, 
          m = \ Quotient[Length[s], \ 2]; \ 
					\ \ \ \ \ m1 = 
            minmax[Take[s, 
                m]]; 
			\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ m2 = minmax[Drop[s, 
                m]]; 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {g[m1[\([1]\)], m2[\([1]\)]], f[m1[\([2]\)], m2[\([2]\)]]}]]\)

minmax[{50, 40, -20, -50, 10, 60, 20, -10, -40, 
        30, -60, -30}]
minmax[{}]

Position[{a, c, b, c, d}, c]

Delete[{a, c, b, c, d}, %]

\( (*\ k\ smallest\ *) 
\(Clear["`*"];\)\)
\(minfun[x_List] := 
      Module[{mn = First[x]}, 
		Do[
          If[Part[x, i] < \ mn, 
            mn = x[\([i]\)]\ ]\ , 
			\ \ \ \ \ \ \ \ \ \ \ \ \ {i, 2, 
            Length[x]}]; mn]\)
\(selectk[x_List, k_] := 
      Module[{temp, xl = x}, 
		Do[
          temp = minfun[xl]; 
			\ \ \ \ xl = 
            Delete[xl, \(Position[xl, temp]\)[\([1, 
                  1]\)]], 
			\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {k}]; temp]\)

lst = {8, -3, 3, 6, 4, -5, 2, -7, -1};

Sort[lst]

selectk[lst, 1 + Round[Length[lst]/2]]
selectk[lst, 2]
Sort[lst]